/*
* © 2010 Autodata Solutions Company. All Rights Reserved
* This source code is the confidential and proprietary information of Autodata Solutions Company.
* The user shall not, in whole or in part, copy, publish, disclose or make any use of this source code
* without the prior written consent of Autodata Solutions Company.
*/
Ext.ns('net.autodata.compare.photos');
(function () {
	
	var DQ = Ext.DomQuery;
	
	/**
	 * @class VehiclePhotoView
	 * @extends net.autodata.AbstractView
	 * @namespace net.autodata.compare.photos
	 */
	var View = Ext.extend(net.autodata.AbstractView, {
		templates: undefined,
		viewCls: '',
		
		constructor: function ()
		{
			View.superclass.ctor.apply(this, arguments);
		},
		
		initTemplates: function ()
		{
			var ts = this.templates || {}; 
			
			if (!ts.mainTpl) {
				ts.mainTpl = new Ext.Template(
					'<div class="vehiclephoto-view {viewCls}">',
						'<div class="image-wrap"></div>',
						'<div class="view-larger"><span class="clickable">' + ASC.message('net.autodata.compare.photos.label.view-larger-image') + '</span></div>',
					'</div>',
					{
						compiled: true,
						disableFormats: true
					}
				);
			}
			
			this.templates = ts;
		},
		
		render: function ()
		{
			var panel = this.component;
			var dom = panel.el.dom;
			
			this.templates.mainTpl.overwrite(dom, {viewCls: this.viewCls || ''});
			panel.iofImage.render(DQ.selectNode('.image-wrap', dom));
		}
		
	});
	
	net.autodata.compare.photos.VehiclePhotoView = View;
	
})();